<?php

class Application_Model_DbTable_Searchterm extends Zend_Db_Table_Abstract
{

    protected $_name = 'SearchTerm';

    public function addSearchTerm($tagID, $threadID)
    {
    	$data = array(
    		'Tag_id' => $tagID,
    		'Thread_id' => $threadID,
    	);
    	
    	$this->insert($data);
    }
    
    public function getThreads($tagID)
    {
    	$tagID = (int)$tagID;
    	$rows = $this->fetchAll("Tag_id = '".$tagID."'");
    	return $rows;
    }

	public function getTags($threadID)
    {
    	$threadID = (int)$threadID;
    	$rows = $this->fetchAll("Thread_id = '".$threadID."'");
    	return $rows;
    }
}

